package com.cxyjy.travelguide.controller;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.Instant;
import java.util.Map;

// 结果封装类
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ProcessedResponse {
    private String content;
    private Map<String, Object> metadata;
    private Instant timestamp;
    private boolean isError;

    // 快速创建错误响应
    public static ProcessedResponse error(String message) {
        return ProcessedResponse.builder()
                .content(message)
                .isError(true)
                .timestamp(Instant.now())
                .build();
    }
}
